Java Unleashed
Second Edition

by Michael Morrison, et al.


C  O  N  T  E  N  T  S




Introduction

Chapter 1  Introducing Java

Chapter 2  Object-Oriented Programming and Java

Chapter 3  Browsing Java

Chapter 4  The Java Developers Kit

Chapter 5  Third-Party Development Tools

Chapter 6  Java Language Fundamentals

Chapter 7  Expressions, Operators, and Control Structures

Chapter 8  Classes, Packages, and Interfaces

Chapter 9  Threads and Multithreading

Chapter 10  Exception Handling

Chapter 11  Overview of the Standard Packages

Chapter 12  The Language Package

Chapter 13  The Utilities Package

Chapter 14  The I/O Package

Chapter 15  The Networking Package

Chapter 16  The Windowing (AWT) Package

Chapter 17  Introduction to Applet Programming

Chapter 18  Programming Applets

Chapter 19  Java Graphics Fundamentals

Chapter 20  Basic Animation Programming

Chapter 21  Creating User Interface Components

Chapter 22  Working with Dialog Boxes

Chapter 23  Introduction to Network Programming

Chapter 24  Developing Content and Protocol Handlers

Chapter 25  Client/Server Fundamentals

Chapter 26  Java Socket Programming

Chapter 27  Multiuser Network Programming

Chapter 28  Java Debugging

Chapter 29  Documenting Your Code

Chapter 30  Optimizing Java Code

Chapter 31  Exploring Database Connectivity with JDBC

Chapter 32  Persistence

Chapter 33  Integrating Native Code

Chapter 34  Java Under the Hood: Inside the Virtual Machine

Chapter 35  Java Securiry

Chapter 36  Building VRML 2.0 Behaviors in Java

Chapter 37  Integrating Java and JavaScript

Chapter 38  Integrating Java and ActiveX

Chapter 39  Using Java with VBScrip

Chapter 40  Developing Intranet Applications with Java

Chapter 41  Java Game Programming

Chapter 42  Advanced Image Processing

Chapter 43  Developing Your Own Database Application

Chapter 44  Just-In-Time Compilers

Chapter 45  Remote Objects and the Java IDL System

Chapter 46  The Standard Extension APIs

Chapter 47  The Scoop on JavaOS, Java Microprocessors, and JAR Files

Chapter 48  Serving the Net with Jeeves

Appendix A  Java Languague Summary

Appendix B  Class Hierarchy Diagrams

Appendix C  The Java Class Library

Appendix D  Differences Between Java and C/C++

Appendix E  Java Resources



Credits


What's New in This Edition

Java Unleashed, Second Edition, is an all-new version of the best-selling First Edition. It includes the best chapters from many different Java books published by Sams.net. All these chapters have been modified and updated to reflect the state of Java as the 1.1 specification approaches release.

Three new parts have been added to this edition:

These additional parts greatly expand the scope of the book and give you new insights into the current and future use of Java. In particular, be sure to check out these powerful new chapters, new to the Second Edition:

A complete set of reference appendixes to enable programmers to quickly get the information they need.

The remaining chapters have been modified and updated with the latest information to provide you with a complete and timely reference to aid you in your Java programming tasks.


Copyright © 1997 by Sams.net Publishing

SECOND EDITION

All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Neither is any liability assumed for damages resulting from the use of the information contained herein. For information, address Sams.net Publishing, 201 W. 103rd St., Indianapolis, IN 46290.

International Standard Book Number: 1-57521-197-1

HTML conversion by :
    M/s. LeafWriters (India) Pvt. Ltd.
    Website : http://leaf.stpn.soft.net
    e-mail : leafwriters@leaf.stpn.soft.net


Trademarks

All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized. Sams.net Publishing cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark. Java is a trademark of Sun Microsystems, Inc.


President, Sams Publishing Richard K. Swadley
Publishing Manager Mark Taber
Managing Editor Cindy Morrow
Director of Marketing John Pierce
Assistant Marketing Managers Kristina Perry, Rachel Wolfe


Acquisitions Editor Beverly M. Eppink Development Editor Kelly Murdock
Software Development Specialist Bob Correll Production Editor Alice Martina Smith
Technical Editor Ramesh Chandak Editorial Coordinator Katie Wise
Technical Edit Coordinator Lorraine E. Schaffer Resource Coordinator Deborah Frisby
Editorial Assistants Carol Ackerman, Andi Richter, Rhonda Tinch-Mize Cover Designer Tim Amrhein
Book Designer Gary AdairCopy Writer Peter Fuller
Production Team Supervisors Brad Chinn, Charlotte Clapp Production Mona Brown, Jennifer Dierdorff, Polly Lavrick, Mark Matthews, Andrew Stone


Introduction

This book is a NetWare encyclopedia that every NetWare administrator or integrator needs for managing a 3.x or 4.x system. The authors of this book, who have a combined NetWare experience of decades, share their most powerful insights. This book is a helpful guide for any integrator or administrator who is caught in the whirlwind of downsizing.

Whether you are integrating NetWare for the first time or you have installed and managed systems for years, this book provides the first line of support for you to embark on any project relative to NetWare. It also gives you direction of where to go for more detailed or comprehensive material on each subject.

Who This Book is For

This book is written for an intermediate to an advanced technical audience. You won't encounter lengthy instructions for copying disks or creating directories. It is assumed that the you have a good fundamental understanding of microcomputers and DOS.

If you have no NetWare experience, the first part will establish a sufficient level of understanding to comprehend the rest of the material.

If you are an experienced NetWare professional, take the time to scan the first part of this book. This book consistently uses certain terms as they are defined here[md]not necessarily as they are defined by Novell. You will find that the mechanics of the NetWare file server operating system, networking software and protocols, and LAN technology are presented in a simple, clear, and precise manner. Your ability to troubleshoot will be enhanced by your studying of what happens inside the system.

How This Book is Organized

This book is organized into the following parts:

Part I. Theory Behind the Practice: This chapters in this part cover the inner workings of NetWare, its protocols, and local area networks (LANs). This part goes into more detail (than Novell training) about how and why NetWare works the way it does.

Part II. Planning and Installation: This part is a guide for integrating NetWare 3.12 and 4.01 versions. It is full of helpful tips[md]gained from the authors' experiences.

Part III. System Administration: This part walks you through the basics of setting up NetWare administration and printing, including the latest additions: BasicMHS, ElectroText online documentation, and the new menu system.

Part IV. Network Management: This part is a survival guide for managing networks using available software tools. This is not a product review, such as those that you read in various periodicals, but a helpful analysis of available tools[md]and what they do for you.

Part V. Internetworks and WANs: This part provides simple and direct instructions for integrating NetWare in an campus-wide and/or enterprise-wide environment. It clarifies routing and bridging issues, and system design for internetworks and wide area networks (WANs).

Part VI. Performance Optimization: This part probes every aspect of NetWare, the underlying LANs, and the WANs that you can exploit for better performance.

Part VII. Preventing Downtime: This part explores the critical failure points, products, and available features to keep your system running nonstop.

Part VIII. Protocol Analysis: This part is a guide to analyzing NetWare and local area network protocols. It is a simple and direct beginning point for using a protocol analyzer with NetWare. This part and a protocol analyzer will help a network professional evolve into a true networking professional.

Part IX. Windows and NetWare: This part explores Windows integration and administration in a NetWare environment.

Part X. Troubleshooting: This part discusses the most likely problems that you'll encounter when something goes wrong. It also shows how to identify and resolve problems.

Appendixes: Support material (including a glossary of NetWare terminology) is offered in the appendixes.

Conventions

Look for the following conventions in this book:

This book is written for an intermediate to an advanced technical audience. You won't encounter lengthy instructions for copying disks or creating directories. It is assumed that the you have a good fundamental understanding of microcomputers and DOS.

If you have no NetWare experience, the first part will establish a sufficient level of understanding to comprehend the rest of the material.

If you are an experienced NetWare professional, take the time to scan the first part of this book. This book consistently uses certain terms as they are defined here[md]not necessarily as they are defined by Novell. You will find that the mechanics of the NetWare file server operating system, networking software and protocols, and LAN technology are presented in a simple, clear, and precise manner. Your ability to troubleshoot will be enhanced by your studying of what happens inside the system.

This book is a NetWare encyclopedia that every NetWare administrator or integrator needs for managing a 3.x or 4.x system. The authors of this book, who have a combined NetWare experience of decades, share their most powerful insights. This book is a helpful guide for any integrator or administrator who is caught in the whirlwind of downsizing.

Whether you are integrating NetWare for the first time or you have installed and managed systems for years, this book provides the first line of support for you to embark on any project relative to NetWare. It also gives you direction of where to go for more detailed or comprehensive material on each subject.

To my best friend in the whole world, Mahsheed, who now just so happens to be my wife.

-Michael Morrison

Acknowledgments

I would like to thank Beverly Eppink for giving me the opportunity to lead such a fun project and to everyone else at Sams.net who contributed to making this book a reality.

I'd also like to thank all the contributing authors, without whom this book would not have been possible.

I would like to thank my family and friends, especially my mom and dad, who give me unyielding encouragement and support.

Finally, I'd like to thank my Nashville skateboarding cronies, Keith, Josh, Heath, and Squirrel, who are kind enough to keep my legend alive.

-Michael Morrison

About the Authors

Lead Author:

Michael Morrison (mmorrison@thetribe.com, www.thetribe.com) is a freelance writer and gearhead living in Scottsdale, Arizona. Michael is the author of Teach Yourself Internet Game Programming with Java in 21 Days, as well as a contributing author to Teach Yourself Java in 21 Days, Premier Edition, and Tricks of the Java Programming Gurus. When not unleashing Java on unsuspecting friends and family, Michael can be found resurrecting his youth on skateboard ramps. Michael wrote Chapters 4, 6, 7, 8, 11, 12, 14, 19, 30, 38, 44, 46, 47, and Appendix D; he coauthored Chapter 3.

Contributing Authors:

Jerry Ablan (munster@mcs.net) is best described as a computer nut. He has been involved in computers since 1982 and has worked on and owned a variety of microcomputers including several that are no longer manufactured. Jerry has programmed in many languages, including several that are not cool (for example, RPG II), and is a senior software engineer at the Chicago Board Options Exchange. He lives in a Chicago suburb with his wife Kathryn, and when not playing WarCraft II with his friends, working, writing, or otherwise cavorting, Jerry and his brother Dan operate NetGeeks (http://www.netgeeks.com), an Internet consulting firm. He is the author of Developing Intranet Applications with Java, coauthor of the Web Site Administrator's Survival Guide, and a contributing author to Special Edition: Using Java; Platinum Edition: Using CGI, HTML, and Java; and Intranets Unleashed. Jerry wrote Chapter 40.

Michael Afergan (mikea@ai.mit.edu) began working with Java as early as the spring of 1995 through his research work at the MIT AI Labs. Since then, he has carefully studied its growth, developing practical applets for companies as an independent consultant. Michael is the author of Java Quick Reference and has taught Java overseas to both managers and programmers. Although only 18, Michael has been programming for 11 years and has even taught a class on computer science at MIT. Captain of his high school wrestling team, he is currently attending Harvard University. Michael wrote Chapter 27.

Rogers Cadenhead (rcade@airmail.net, http://www.cruel.com/rcade) is a Web developer, computer programmer, and writer who created the multiuser games Czarlords and Super Video Poker. Thousands of readers see his work in the Fort Worth Star-Telegram question-and-answer column "Ask Ed Brice." Rogers has developed Java applets for Tele-Communications Inc. and other clients, and is the coauthor of Teach Yourself SunSoft's Java Workshop in 21 Days. Rogers wrote Chapters 1, 5, 17, and 18 and contributed to Chapter 2.

David R. Chung (dchung@inav.net, http://soli.inav.net/~dchung) is a senior programmer in the Church Software Division of Parsons Technology in Hiawatha, Iowa. His current projects include Windows and the Internet, and he moonlights teaching C and C++ to engineers for a local community college. In his spare time, David enjoys bicycling, teaching adult Sunday school, rollerblading, skiing, windsurfing, preaching in a nursing home, tennis, 2-player and 6-player volleyball, playing the clarinet, and speaking French. He is the father of six children whose names all begin with J and contributed to Tricks of the Java Programming Gurus. David wrote Chapters 10, 16, and 21.

Justin Couch (justin@vlc.com.au, http://www.vlc.com.au/~justin) works as software engineer for ADI Ltd. He also runs The Virtual Light Company, a small VRML and Java Web publishing company located in Sydney, Australia. Coauthor of Laura Lemay's Web Workshop: 3D Graphics and VRML 2, Justin is an active member of both the VRML standards and Java-VRML mailing lists. Currently, he is involved in research on using VRML to create seamless worlds on the Internet and can be found most days in the CyberGate community Point World, under the name Mithrandir. When not pushing the limits, he relaxes by playing bassoon and clarinet and going gliding. Justin wrote Chapter 36.

Rick Darnell (darnell@montana.com), a contributing author to FrontPage Unleashed and Microsoft Internet Explorer 3 Unleashed, is a midwest native currently living with his wife and two daughters in Missoula, Montana. He began his career in print at a small weekly newspaper after graduating from Kansas State University with a degree in broadcasting. While spending time as a freelance journalist and writer, Rick has seen the full gamut of personal computers, since starting out with a Radio Shack Model I in the late 1970s. When not in front of his computer, he serves as a volunteer firefighter and member of a regional hazardous materials response team. Rick wrote Chapter 37.

John December (john@december.com, http://www.december.com) is owner of December Communications, the publisher of Computer-Mediated Communication Magazine, and several widely used and frequently accessed World Wide Web-based reference publications about the Internet and the Web. An experienced Internet writer, teacher, software developer, and author, he holds an M.S. degree in computer science, an M.F.A. degree in creative writing, and is a Ph.D. candidate in communication and rhetoric at Rensselaer Polytechnic Institute. He is coauthor of The World Wide Web Unleashed, HTML & CGI Unleashed, and Presenting Java, all published by Sams.net Publishing. He wrote Appendix E.

Mike Fletcher (fletch@ain.bls.com) graduated from Georgia Institute of Technology in 1994 and now works for BellSouth Wireless's AIN Services Group as a system administrator. Mike was a contributing author to the first edition of Java Unleashed. He once played tuba on stage with Jimmy Buffet, and his interests include reading science fiction and juggling. Mike wrote Chapters 15, 23, 24, 45, and 48.

Michael Girdley (girdleyj@allwilk.com, http://www.lafayette.edu/~girdleyj/) contributed to Web Programming with Java and is the chief consultant at Allwilk Consulting (http://www.allwilk.com/), an organization specializing in Web site creation and Java programming. He is currently pursuing a Bachelor of Science degree in computer science at Lafayette College in Easton, Pennsylvania, and will earn his fourth varsity letter in 1996-1997 as a member of the varsity swimming team. Originally from San Antonio, Texas, Michael hopes to find a job or go to graduate school after possibly graduating on time in May 1997. Michael coauthored Chapter 13.

K.C. Hopson (chopson@universe.digex.net, http://www.universe.digex.net/~chopson) is President of Geist Software and Services, Inc., an independent consulting firm in the Baltimore/Washington D.C. metro area. He specializes in distributed computing solutions and has deep experience in GUI programming (especially Windows), relational databases, and client/server products. K.C. received a B.S. degree in applied mathematics from the University of California, Irvine, and an M.S. in computer science from the University of Maryland, Baltimore County, and was a lead architect of the software used in Bell Atlantic's Stargazer interactive television system. Coauthor of Developing Professional Java Applets, K.C. thrives in cyberspace and enjoys using it to work anywhere in the world. In his spare time, he enjoys his family, plays music of all kinds, and studies history and literature. K.C. wrote Chapter 22 and coauthored Chapter 42.

Steve Ingram (singram@qnet.com) is a computer consultant in the Washington D.C. metro area specializing in embedded data communications and object-oriented design. Coauthor of Developing Professional Java Applets and contributor to Tricks of the Java Programming Gurus, Steve holds an electrical engineering degree from Virginia Tech and has been programming for 15 years. He was the architect behind the language of Bell Atlantic's Stargazer interactive television project, where he first encountered Java. When he's not working, Steve likes to sail the Chesapeake Bay with his wife and son. Steve wrote Chapters 26 and 34 and coauthored Chapter 42.

John J. Kottler (73157.335@compuserve.com, jkottler@aol.com, or jay_kottler@msn.com) has been programming for 14 years and has spent the past 6 years developing applications for the Windows platform. He has programmed multimedia applications for more than two years and has spent this past year developing for the Web. His knowledge includes C/C++, Visual Basic, Lotus Notes, PowerBuilder, messaging-enabled applications, multimedia and digital video production, and Web page development. John contributed to Presenting ActiveX, Web Publishing Unleashed, Netscape 2 Unleashed, and Programming Windows 95 Unleashed; he codeveloped the shareware application Virtual Monitors. A graduate of Rutgers University with a degree in computer science, he enjoys rollerblading, cycling, and playing digital music in his spare time. John wrote Chapter 39.

Laura Lemay (lemay@lne.com, http://www.lne.com/lemay/) is the author of several best-selling books about the Internet and the World Wide Web, including Teach Yourself Java in 21 Days and Teach Yourself Web Publishing with HTML. After receiving her degree in technical writing from Carnegie-Mellon University in 1989, she wrote documentation at various Silicon Valley software companies before writing her first book in 1994. She also writes a monthly column on HTML and Web page design for Web Techniques Magazine. Laura has won Awards of Merit and Excellence from the Society of Technical Communication for her work and has spoken to diverse audiences ranging from programmers to industry pundits to librarians and to junior high school girls. She makes frequent appearances and lectures in the San Francisco Bay Area. She is the original author of Chapter 2 and Appendixes A and C.

Richard Lesh (rich@micros.umsl.edu) is an instructor with the microcomputing program at the University of Missouri, St. Louis. He has developed a variety of applications for the Macintosh, PC, and various UNIX platforms. A number of software products that he has developed are in national distribution, including PLANMaker, a business plan-building product, and a number of screen saver modules published by Now Software in Now Fun! and by Berkeley Systems in After Dark. Richard contributed to Chapter 13.

Tim Macinta (twm@mit.edu) is currently working towards a degree in computer science and electrical engineering at the Massachusetts Institute of Technology. He has been working with Java since the summer of 1995 when he joined Dimension X, one of the leaders in Java development. While at Dimension X, Tim developed the first commercial-quality Java chat applet along with several applets for commercial sites such as the Disney and Monopoly sites. More recently, he has been using Java to write several client/server applications (SMTP, POP, and IRC, to name a few) from the ground up. After graduating from MIT, Tim plans to start a company whose sole purpose will be to grab market share from Microsoft. Tim wrote Chapter 41.

Bryan Morgan is a software engineer with TASC, Inc. in Fort Walton Beach, Florida. He holds a B.S. degree in electrical engineering from Clemson University and is currently using Java to build Web applications as well as to perform Web-based distributed interactive simulations. Bryan and his wife, Becky, are expecting their first child in November 1996. Bryan is the coauthor of Teach Yourself SQL in 14 Days and Teach Yourself ODBC in 21 Days. Bryan co-authored Chapter 3.

Tim F. Park (tpark@leland.stanford.edu) is a recent graduate of the Stanford Graduate School of Electrical Engineering. Now employed by a major computer company in Silicon Valley, he is currently working on a Java 3D graphics library for the Internet. He contributed to Tricks of the Java Programming Gurus, and his interests include distributed computing, computer graphics, and mountain biking. Tim wrote Chapters 28 and 33.

Charles L. Perkins (virtual@rendezvous.com) is the founder of Virtual Rendezvous (http://rendezvous.com/java), a company building a Java-based service that fosters socially focused, computer-mediated, real-time, filtered interactions between people's personas in the virtual environments of the near future. In previous lives, he has evangelized NeXTSTEP, Smalltalk, and UNIX, and has degrees in both physics and computer science. He is the author of Appendix B.

George Reese (borg@imaginary.com) holds a philosophy degree from Bates College in Lewiston, Maine. He currently works as a consultant with York and Associates, Inc. and as a magazine columnist for the Java Developer's Journal. George has written some of the most popular mud software on the Internet, including the Nightmare Object Library and the Foundation Object Library. For Java, he was the creator of the first JDBC implementation, the Imaginary JDBC Implementation for mSQL. He contributed to Tricks of the Java Programming Gurus, and his Internet publications include the free textbooks on the LPC programming language, LPC Basics and Intermediate LPC. George lives in Bloomington, Minnesota, with his two cats, Misty and Gypsy. George wrote Chapters 25, 29, 31, and 43.

Chris Seguin (seguin@uiuc.edu) is an Eagle Scout. He completed a B.S. degree in computational mathematics at the University of Delaware in 1991, and on June 25, 1994, married his long-time sweetheart, Angela DiNunzio. Chris is currently working toward his Ph.D. at the University of Illinois in computer science in the area of artificial intelligence. For the past three years, he has been a teaching assistant for the introductory computer science class for majors. His research interests include using artificial neural networks for signal processing and developing teaching and collaboration tools on the World Wide Web in Java. Chris wrote Chapter 20.

Glenn Vanderburg (glv@vanderburg.org, http://www.vanderburg.org/~glv/) is a software architect with BusinessWorks, Inc., where he is using Java to support multimedia educational systems. Glenn lives in Plano, Texas, with his wife, Deborah. He holds a B.S. degree in computer science from Texas A&M University. Glenn is the lead author of Tricks of the Java Programming Gurus and is interested in using Java to build dynamically extensible, upgradable network applications. Glenn wrote Chapter 35.

Eric Williams (williams@sky.net, http://www.sky.net/~williams) is a team leader and software engineer for Sprint's Long Distance Division. Although currently focusing on C++ and Smalltalk development, Eric is active in the Java community, contributing to the comp.lang.java newsgroup and delivering presentations about Java to various user groups. Eric is also responsible for identifying a Java 1.0.1 security flaw related to sockets and DNS. Eric wrote Chap-ters 9 and 32.

Tell Us What You Think!

As a reader, you are the most important critic and commentator of our books. We value your opinion and want to know what we're doing right, what we could do better, what areas you'd like to see us publish in, and any other words of wisdom you're willing to pass our way. You can help us make strong books that meet your needs and give you the computer guidance you require.

Do you have access to CompuServe or the World Wide Web? Then check out our CompuServe forum by typing GO SAMS at any prompt. If you prefer the World Wide Web, check out our site at http://www.mcp.com.

Note
If you have a technical question about this book, call the technical support line at (800) 571-5840, ext. 3668.

As the team leader of the group that created this book, I welcome your comments. You can fax, e-mail, or write me directly to let me know what you did or didn't like about this book-as well as what we can do to make our books stronger. Here's the information:

Fax:(317) 581-4669
E-mail:newtech_mgr@sams.mcp.com
Snail mail:Mark Taber
Comments Department
Sams.net Publishing
201 W. 103rd Street
Indianapolis, IN 46290

Introduction

Just over a year after its inception, Java is still the dominant technology bringing interactive content to the World Wide Web. In a world where just about everyone has his or her own opinion about where the future of the Web is headed, this is no small feat. JavaSoft, the division of Sun Microsystems responsible for Java, has managed to stay ahead of the development curve and steadily improve Java to accommodate the rapidly changing environment known as the Web. Even so, Java is still a new technology and has plenty of room to evolve to meet the demands of Web developers.

The fact that Java is an evolving technology has played a critical role in its wide acceptance by Web developers; many developers who struggle with limitations in the current release of Java feel confident that JavaSoft will quickly remedy the situation in a future release. This confidence depends greatly on JavaSoft's willingness and desire to solicit input from experts in the field when expanding Java to solve new problems and provide new features. Since initially releasing Java, JavaSoft has been steadily improving Java to meet the needs of the demanding Web community. More recently, JavaSoft has been busily working on significant features that will impact almost every aspect of Java development.

As of this writing, JavaSoft is closing in on the release of Java 1.1, which is the next major Java release since Java 1.02. JavaSoft has been relatively open about the enhancements and additions that will appear in Java 1.1, although they have evaded mentioning anything conclusive. A strong effort has been made in this book to highlight areas of Java that may change or be impacted by the imminent release of Java 1.1. Just keep in mind that any Java 1.1 material mentioned here is based on preliminary reports from JavaSoft and is subject to change in the final release of Java 1.1. Nevertheless, this coverage of Java 1.1 should give you a great deal of insight into the future of Java.

Aside from including references to Java 1.1, you may wonder exactly why we think a Second Edition of this book is necessary. The truth is that there is just too much new material that isn't covered anywhere else. More specifically, this edition includes completely new coverage of topics such as custom user interface components, client/server networking, code optimization, database connectivity, persistence, ActiveX integration, VBScript integration, intranet applications, image processing, just-in-time compilers, remote objects, and emerging Java technologies. As if those topics aren't enough to warrant this edition, the First Edition material that managed to make it into this edition has been completely revised to accommodate both the incremental changes in Java 1.02 and the projected changes in Java 1.1.

Our goal in this edition is to explore the Java technology from a variety of angles so that you can see the bigger picture of what Java has to offer as a Web technology. Our contention is that if you understand Java in its entirety, you will be much better suited to make decisions regarding its efficient use in your own Web development projects. Beyond that, we also thought it would be a lot of fun to chart some new territory and see for ourselves what Java could do!

In this book, you learn about the following topics related to the Java technology:

This book is divided into 10 parts that neatly cover each of these topics.

Part I: Getting Started with Java

Every exploration has to start somewhere-you're ready to begin learning about the vast world of Java. You want to know why Java is an object-oriented language and what this really means in a practical sense. You'd also like to know exactly where to begin as far as setting up your own Java development environment.

Part II: The Java Language

The cornerstone of the Java technology is the Java programming language. You understand Java in general terms, but you want to know more about the Java language and what it can do for you. You are curious about Java classes and how they relate to all the object-oriented hype you've heard about Java. You also want to know what in the world threads and exceptions are, and why so many people seem so worried about them.

Part III: The Standard Java Programming Packages

The real power of Java is spelled out in the standard Java programming packages. You're ready to move past the Java language and see exactly what Java provides in the way of specific programming features such as mathematical functions, I/O, and networking. You're also curious about graphical user interfaces and what kinds are available in the standard Java packages.

Part IV: Creating Java Applets

How popular would Java be without applets? Probably not very, which is why you just have to know how to start developing your own. You don't just want to develop run-of-the-mill applets, however, you want to create applets with graphics, animation, and fancy user interfaces.

Part V: Networking with Java

Can you possibly imagine a programming language for the Web that doesn't provide extensive support for networking? Of course not! You want to know all about networking with Java and exactly what it can do for you. You've heard a lot about client/server networking and want to know how it is supported in Java. You're also interested in writing a multiuser applet in Java.

Part VI: Java Programming Strategies

You realize the importance of smart programming and want to know some Java programming strategies to help improve development efficiency. You understand the inherent nature of programming bugs and want to know how to debug Java code. You want to employ a documentation strategy so that your code can be better maintained. You are also interested in speeding up your code, because performance is a very critical issue in Java programming.

Part VII: Advanced Java Programming

You are ready to press on to some more advanced areas of Java programming. More specifically, you have an interest in connecting Java programs to existing databases. You want to learn about persistence, a technique for storing and retrieving the state of Java objects. You are also interested in how Java integrates with native C code, as well as finding out more about the Java virtual machine and Java security.

Part VIII: Integrating Java with Other Technologies

Although Java is a pretty complete technology, there are still instances where you may want to integrate Java with another technology such as ActiveX. You want to know some details surrounding the integration of Java with technologies such as VRML, ActiveX, JavaScript, and VBScript.

Part IX: Applied Java

A software development technology is only as useful as its range of application. Knowing this, you want to see some specific areas of application where Java can be used. More specifically, how can Java be applied to intranets, games, image processing, and custom databases?

Part X: Emerging Java Technologies

Even though Java has come a long way, the story of Java is still very much being written. You're interested in emerging Java technologies because they play a significant role in determining the future of software development for the Web. More specifically, you want to know more about just-in-time compilers, remote objects, the standard extension APIs, JavaOS, Java microprocessors, and JAR files.

We can certainly use Java's past as a means of forecasting its future, but ultimately, we must keep an open mind and be willing to adapt to changes in Java as they unfold. Knowing that, I encourage you to set out on your own exploration of Java using this book as your guide. Have fun!

-Michael Morrison